Make gtk_tooltip_trigger_tooltip_query work again
authorMatthias Clasen <mclasen@redhat.com>
Mon, 6 Jun 2016 01:47:16 +0000 (21:47 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 6 Jun 2016 01:47:16 +0000 (21:47 -0400)
This was broken ever since we started looking at the
source device of the event.

https://bugzilla.gnome.org/show_bug.cgi?id=674215

gtk/gtktooltip.c

index 12a7b357dd5b71dd355c5ff9ec6e4182e5432ae7..e0672ae9d670ebbfa2839a5b365a4bd8db56bc9f 100644 (file)
@@ -149,6 +149,8 @@ static void       gtk_tooltip_display_closed       (GdkDisplay      *display,
 static void       gtk_tooltip_set_last_window      (GtkTooltip      *tooltip,
                                                    GdkWindow       *window);
 
+static void       gtk_tooltip_handle_event_internal (GdkEvent        *event);
+
 static inline GQuark tooltip_quark (void)
 {
   static GQuark quark;
@@ -460,7 +462,7 @@ gtk_tooltip_trigger_tooltip_query (GdkDisplay *display)
   event.motion.x_root = x;
   event.motion.y_root = y;
 
-  _gtk_tooltip_handle_event (&event);
+  gtk_tooltip_handle_event_internal (&event);
 }
 
 /* private functions */
@@ -1404,6 +1406,15 @@ tooltips_enabled (GdkEvent *event)
 
 void
 _gtk_tooltip_handle_event (GdkEvent *event)
+{
+  if (!tooltips_enabled (event))
+    return;
+
+  gtk_tooltip_handle_event_internal (event);
+}
+
+static void
+gtk_tooltip_handle_event_internal (GdkEvent *event)
 {
   gint x, y;
   gboolean return_value = FALSE;
@@ -1411,9 +1422,6 @@ _gtk_tooltip_handle_event (GdkEvent *event)
   GdkDisplay *display;
   GtkTooltip *current_tooltip;
 
-  if (!tooltips_enabled (event))
-    return;
-
   /* Returns coordinates relative to has_tooltip_widget's allocation. */
   has_tooltip_widget = find_topmost_widget_coords_from_event (event, &x, &y);
   display = gdk_window_get_display (event->any.window);